#ifndef PIXMAPBUTTON_H
#define PIXMAPBUTTON_H

#include <QtCore/qglobal.h>

#include <QPushButton>
#include <QPixmap>

namespace BC {
    enum PixmapButtonStatus{
        PixmapButtonNoStatus,
        PixmapButtonSignStatus,
        PixmapButtonDoubleStatus,
    };
}

class Q_DECL_EXPORT PixmapButton : public QPushButton
{
public:
    PixmapButton(QWidget *parent = nullptr);
    PixmapButton(const QString &released, const QString &pressed,
                 const int width = 0, const int height = 0, QWidget *parent = nullptr);
    PixmapButton(const QPixmap &released, const QPixmap &pressed,
                 QWidget *parent = nullptr);
    PixmapButton(const QString &released, const QString &pressed, const QString &background,
                 const int width = 0, const int height = 0, QWidget *parent = nullptr);
    ~PixmapButton();

private:
    void paintEvent(QPaintEvent *) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;

private:
    BC::PixmapButtonStatus m_pushbutton_status;
    bool m_mouse_pressed;
    QPixmap *m_pixmap_released;
    QPixmap *m_pixmap_pressed;
    QPixmap *m_pixmap_background;
};

#endif // PIXMAPBUTTON_H
